package com.shortUrl.starter.util;

public class DecimalConversionUtils {
    public static String BASE = "abcdefghijkrmnopqrstuvwxyzABCDEFGHIJKRMNOPQRSTUVWXYZ0123456789";

    public static String  to62(Long id){
        StringBuffer result = new StringBuffer();
        Integer baseLen = BASE.length();
        Long index = 0L;
        while(id!=0){
            index  = id%baseLen;
            result.append(BASE.charAt(index.intValue()));
            id  /= baseLen;
        }
        return result.toString();
    }
}
